-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#507] waitset adjustments #509
[#507] waitset adjustments #509
Conversation
…rocess calls; rename try_wait_and_process into wait_and_process_once
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #509 +/- ##
==========================================
+ Coverage 79.19% 79.29% +0.10%
==========================================
Files 200 200
Lines 23716 23757 +41
==========================================
+ Hits 18781 18838 +57
+ Misses 4935 4919 -16
|
auto run_callback(iox2_waitset_attachment_id_h attachment_id, void* context) { | ||
auto* fn_call = internal::ctx_cast<iox::function<void(WaitSetAttachmentId<S>)>>(context); | ||
fn_call->value()(WaitSetAttachmentId<S>(attachment_id)); | ||
auto run_callback(iox2_waitset_attachment_id_h attachment_id, void* context) -> iox2_callback_progression_e { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious - why is the C enum used? I guess it's because this is called directly by the C API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@orecham this is just the internal implementation. I need a C style callback in the C++ API that has the C++ iox::function
stored in context
and can be used as a callback in the C API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one question.
Notes for Reviewer
DeadlineQueue::missed_deadlines()
callback needs to returnCallbackProgression
so that the user is able to stop handling missed deadlines when required.WaitSet::try_wait_and_process
was renamed toWaitSet::wait_and_process_once
since the function was actually blocking in contrast what the name suggested with thetry_
prefixWaitSet::wait_and_process
andWaitSet::wait_and_process_once
callbacks need to returnCallbackProgression
to terminate event handling whenever required - this replaces the buggyWaitSet::stop()
call.Pre-Review Checklist for the PR Author
SPDX-License-Identifier: Apache-2.0 OR MIT
iox2-123-introduce-posix-ipc-example
)[#123] Add posix ipc example
)task-list-completed
)Checklist for the PR Reviewer
Post-review Checklist for the PR Author
References
Closes #507